﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ymatou.API.Common
{
    /// <summary>
    /// 文件基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class IFileRequest<T> : BaseRequestModel<T> where T : IFileResponse
    {
        /// <summary>
        /// 默认post类型
        /// </summary>
        public override bool HttpGet
        {
            get
            {
                return false;
            }
        }
        /// <summary>
        /// 需要上传的文件
        /// </summary>
        private List<FileItem> _Files;
        [JsonIgnore]
        public  List<FileItem> Files
        {
            get { return GetFiles(); }
            set { _Files = value; }
        }
        public virtual List<FileItem> GetFiles()
        {
            if (_Files == null || _Files.Count == 0)
            {
                _Files = new List<FileItem>();
               
            }
            return _Files;
        }
    }
}
